package com.carter.springframework.beans.factory.support;

import com.carter.springframework.beans.exception.BeanException;
import com.carter.springframework.core.io.Resource;
import com.carter.springframework.core.io.ResourceLoader;

/**
 * bean定义读取接口
 */
public interface BeanDefinitionReader {
    /**
     * 获取bean定义的registry
     * @return
     */
    BeanDefinitionRegistry getRegistry();

    /**
     * 获取resourceLoader
     * @return
     */
    ResourceLoader getResourceLoader();

    /**
     * 通过resource读取bean定义
     * @param resource
     * @throws BeanException
     */
    void loadBeanDefinitions(Resource resource) throws BeanException;

    /**
     * 通过多个resource读取bean定义
     * @param resources
     * @throws BeanException
     */
    void loadBeanDefinitions(String... resources) throws BeanException;

    /**
     * 通过路径读取bean定义
     * @param location
     * @throws BeanException
     */
    void loadBeanDefinitions(String location) throws BeanException;


}
